home *** CD-ROM | disk | FTP | other *** search
- " Editing functions for equations.
- "
- "
- *
- * /home/2user2/richards/cvs/491/aa/selection.self,v 1.6 1993/07/18 20:22:33 richards Exp
- *
- * selection.self,v
- # Revision 1.6 1993/07/18 20:22:33 richards
- # Added substitution of polynomials (not quite working properly yet).
- # Some tests for this added to test4.
- # Buttons work, selections work, and eventHandling is coming along.
- #
- # Revision 1.5 1993/07/14 16:51:13 richards
- # Renamed editor.self to selection.self.
- #
- # Revision 1.4 1993/07/13 21:47:01 richards
- # July 13 checkin.
- #
- # Revision 1.3 1993/06/23 21:18:10 richards
- # Daily checkin.
- #
- # Revision 1.2 1993/06/23 02:04:24 richards
- # Progress towards being able to select equations.
- #
- # Revision 1.1 1993/06/23 00:36:52 richards
- # Editor.self contains the code to do selection, and eventually, all user interaction.
- #
- *
- *
- "
-
- aa _AddSlotsIfAbsent: (| editor = () |).
-
- aa editor _AddSlotsIfAbsent: (|
- ^ prototypes* = ().
- ^ oddballs* = ().
- ^ traits = ().
- ^ mixins = ().
- |)
-
- " **** SELECTION RECORD ***** "
-
- aa editor traits _AddSlotsIfAbsent: (|
- portion = ().
- selectedPortion = ().
- unselectedPortion = ().
- |)
-
- aa editor prototypes _AddSlotsIfAbsent: (|
- selectedPortion = ().
- unselectedPortion = ().
- |)
-
- " **************
- TRAITS SECTION
- **************
- "
-
- aa editor traits portion _Define: (|
- parent* = traits clonable.
-
- ^ becomeSelected = (
- selectionParent: aa editor traits selectedPortion.
- selectedViews: set copy.
- ).
-
- ^ becomeSelectedWith: vue = (
- becomeSelected.
- selectedArea: vue area.
- selectedBoite: vue model canonicalPolyObject.
- selectedPolynum: selectedBoite polyObject.
- selectedWindow: vue heavySuperView.
- selectedViews add: vue.
- highlightViews.
- ).
-
- ^ becomeUnselected = (
- selectionParent: aa editor traits unselectedPortion.
- selectedViews do: [ |:aSv|
- aSv unHighlight.
- ].
- selectedViews: set copy.
- iPolynum: nil.
- iBoite: nil.
- iArea: (0@0)#(0@0).
- ).
- |)
-
- aa editor traits selectedPortion _Define: (|
- parent* = aa editor traits portion.
-
- ^ copy = (| c. |
- c: clone.
- c selectedArea: selectedArea copy.
- c selectedViews: set copy.
- c
- ).
-
- isValidSelection = ( true ).
-
- becomeEnclosingEqn = (| up. |
- up: selectedBoite upPolyObject.
- up isNil ifFalse: [
- selectedBoite: up.
- selectedBoite leafsDo: [ | :aSubBoite. subBoiteView. |
- (selectedWindow boiteSubViews includesKey: aSubBoite) ifTrue: [
- subBoiteView: selectedWindow boiteSubViews at: aSubBoite.
- selectedArea: selectedArea union: subBoiteView area.
- subBoiteView highlight.
- selectedViews add: subBoiteView.
- ].
- ].
- selectedPolynum: selectedBoite polyObject.
- ] True: [
- becomeUnselected.
- ].
- ).
-
- highlightViews = (
- selectedBoite leafsDo: [ | :aSubBoite. subBoiteView. |
- (selectedWindow boiteSubViews includesKey: aSubBoite) ifTrue: [
- subBoiteView: selectedWindow boiteSubViews at: aSubBoite.
- selectedArea: selectedArea union: subBoiteView area.
- subBoiteView highlight.
- selectedViews add: subBoiteView.
- ].
- ].
- ).
-
- ^ selectedArea = ( iArea ).
- ^ selectedArea: a = ( iArea: a ).
- ^ selectedPolynum = ( iPolynum ).
- ^ selectedPolynum: p = ( iPolynum: p ).
- ^ selectedBoite = ( iBoite ).
- ^ selectedBoite: v = (iBoite: v).
- |)
-
- " dummy to indicate failure to match anything "
-
- aa editor traits unselectedPortion _Define: (|
- _ parent* = aa editor traits portion.
- ^ copy = (| c. |
- c: clone.
- c
- ).
-
- ^ isValidSelection = ( false ).
- ^ selectedArea = ((0@0)#(0@0)).
- ^ selectedPolynum = (nil).
- ^ selectedBoite = (nil).
- |)
-
-
- " ******************
- PROTOTYPES SECTION
- ******************
- "
-
- aa editor prototypes selectedPortion _Define: (|
- _ selectionParent* <- aa editor traits selectedPortion.
- ^ iArea <- (0@0)#(0@0).
- ^ selectedWindow.
- ^ iBoite.
- ^ iPolynum.
- ^ selectedViews.
- |)
-
- aa editor prototypes unselectedPortion _Define: (|
- _ selectionParent* <- aa editor traits unselectedPortion.
- ^ iArea <- (0@0)#(0@0).
- ^ selectedWindow.
- ^ iBoite.
- ^ iPolynum.
- ^ selectedViews <- set copy.
- |)
-
-
-
-
-